import axios from 'axios'
const URL = 'http://localhost:8888/api/private/v1/'
axios.defaults.baseURL = URL
// Add a request interceptor
axios.interceptors.request.use(function (config) {
 var token = localStorage.getItem('adminToken')
 if (token) {
   console.log(config)
   
  config.headers["Authorization"] = token
 }
  return config;
}, function (error) {
  // Do something with request error
  return Promise.reject(error);
});
export const checkLogin = (params) => {
  return axios.post('login', params).then(res => res.data)
}
